#include <iostream>
#include <string>

using namespace std;

struct uuidGenerator {
	int cur = 0;
	string getCur() {
		return to_string(++cur);
	}
	static uuidGenerator* getInstance() {
		static uuidGenerator* instance = new uuidGenerator();
		return instance;
	}
};

struct numbered {
	numbered() :mysn(uuidGenerator::getInstance()->getCur())
	{
	}

	numbered(const numbered& num){
		mysn = uuidGenerator::getInstance()->getCur();
	}

	std::string mysn;
};

void f(const numbered& s) {
	cout << s.mysn << endl;
}

int main()
{
	numbered a, b = a, c = b;
	f(a); f(b); f(c);
	return 0;
}
